<?php 
	class CommonControl extends Control{
		public function __construct(){
			parent::__construct();
			if(!isset($_SESSION['aid'])||!isset($_SESSION['adminname'])){
				go(__ROOT__.'?c=Login');
			}
		}
	/**
	 * 递归重新排序无限极分类数组
	 */
	public function limitless($data,$pid=0,$level=0){
		$arr = array();
		foreach ($data as $v) {

			if($v['pid'] == $pid){
				$v['level'] = $level;
				$v['html'] = str_repeat('_', ($level * 9));
				$arr[] = $v;
				$arr = array_merge($arr, $this->limitless($data, $v['cid'],$level + 1));
			}
		}

		return $arr;
	}




		
	}


 ?>